from selenium.webdriver.common.by import By

from xinan_ui.proxy.account_login import AccountLogin
from xinan_ui.proxy.bjs_page.bjs_buy import BjsBuy
from xinan_ui.proxy.bjs_page.bjs_sell import BjsSell
from xinan_ui.proxy.bjs_page.enter_bjspage import EnterPage
from xinan_ui.proxy.fir1_page import Fir01Page
from xinan_ui.proxy.phone_uilogin import PhoneLoginUi
from xinan_ui.tools.App_driver import AppDriver01
from xinan_ui.tools.read_yml_xn import ReadYaml
from xinan_ui.tools.swipe_pro import SwipeTool

device_data=ReadYaml('../config/devices.yml').read_yaml()['huawei']
driver=AppDriver01().get_driver(desired_caps=device_data)

F1=Fir01Page(driver)
F1.x.driver=driver
F1.go_fir_page()
l=PhoneLoginUi(driver).phone_login('15680036769')
AccountLogin(driver).account_login("181001508","111111")
SwipeTool(driver).mobile_page_swip()

EnterPage(driver).enter_bjs()
# BjsBuy(driver).buy("873593",10,200)
BjsSell(driver).sell("873593",10,200)


